package FSMDemo.entity.Harvester.states
{
	import FSMDemo.entity.Harvester.Harvester;
	
	import com.cheezeworld.AI.Behaviors.Wander;
	import com.cheezeworld.AI.FSM.IState;
	
	import flash.events.EventDispatcher;

	public class WanderState extends EventDispatcher implements IState
	{
		public function setEntity( a_entity:* ) : void
		{
			if( !(a_entity is Harvester) )
			{
				throw new Error( "<WanderState> a_entity must be of type Harvester!" );
			}
			m_entity = a_entity;
		}
		
		public function getEntity() : *
		{
			return m_entity;
		}
		
		public function enter():void
		{
			m_entity.steering.clearBehaviors();
			m_entity.velocity.Set( 0, 0 );
			m_entity.steering.addBehavior( new Wander());
		}
		
		public function execute():void
		{
				
		}
		
		public function exit():void
		{
		}
		
		private var m_entity:Harvester;
		
	}
}